package tiandang.core.dao;

import org.apache.ibatis.annotations.Param;
import tiandang.core.model.Manager;

import java.math.BigDecimal;
import java.util.List;

public interface ManagerMapper {
  int deleteByPrimaryKey(Integer id);

  int insert(Manager record);

  int insertSelective(Manager manager);

  Manager selectByPrimaryKey(Integer id);

  int updateByPrimaryKeySelective(Manager manager);

  void setFrozen(@Param("id") Integer id, @Param("status") Integer status);

  List<Manager> getListByParams(@Param("name") String name, @Param("limit") Integer limit, @Param("offset") Integer offset);

  int countByParams(@Param("name") String name);

  List<Manager> getListByName(@Param("name") String name);

  void addFrozenReward(@Param("id") Integer id, @Param("reward") BigDecimal reward);

  void resetFrozenRewardToNoBalance();

  void balanceReward(@Param("id") Integer id);

  void minusFrozenReward(@Param("id") Integer id, @Param("reward") BigDecimal reward);

  List<Manager> getListByIdList(@Param("idList") List<Integer> idList);

  List<Manager> getAllNormal();

  List<Manager> getAll();

  void updateOpenidById(@Param("id") Integer id, @Param("openid") String openid);
}